package com.qd.common.flow.domain.approval;

import com.cdqidi.util.page.BaseQuery;
import com.qd.common.flow.domain.bill.FlowTaskDTO;
import lombok.Data;

import java.util.Optional;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjk
 * @create 2024-02-29 13:03
 * @since 1.0.0
 */
@Data
public class FlowDataDTO<T extends BaseQuery> {
    /**
     * 信息
     */
    private T data;
    /**
     * 流程信息
     */
    private FlowTaskDTO flow;

    public void freeData() {
        Optional.ofNullable(data).ifPresent(BaseQuery::freeData);
        Optional.ofNullable(flow).ifPresent(FlowTaskDTO::freeData);
    }
}